class Data {
    public int year;
    public int month;
    public int day;
    public void setDay1(int year,int month,int day) {
        this.year = year;
        this.month = month;
        this.day = day;
    }
    public void setDay(int y,int m,int d) {
        year = y;
        month = m;
        day = d;
    }
    public void printDay() {
        System.out.println(year + "/" + month + "/" +day);
    }
}
class Student {
    public String name;//姓名
    public int age;//年龄
    public Student() { //构造方法
        this("小张",19);
        System.out.println("Student()");
    }
    public Student(String name,int age) {  //含有参数的构造方法
        System.out.println("1111");
        this.name = name;
        this.age = age;
    }
    public void setStudent(String name,int age) {
        this.name = name;
        this.age = age;
    }

    public Student(String name) {
        this.name = name;
    }

    public Student(int age) {
        this.age = age;
    }

    public void printStudent() {
        System.out.println("姓名："+name+"\n年龄："+age);
    }
}
public class Test2 {
    public static void main(String[] args) {
        Student s1 = new Student();

        //Student s2 = new Student("小魏",20);




        //s1.setStudent("小魏",20);
        s1.printStudent();
    }
    public static void main2(String[] args) {
        Data data = new Data();
        data.setDay1(2023,10,21);
        data.printDay();
    }
    public static void main1(String[] args) {
        //构造三个日期的实例
        Data data1 = new Data();
        Data data2 = new Data();
        Data data3 = new Data();
        //对三个日期进行设置初始化
        data1.setDay(2004,8,12);
        data2.setDay(2004,8,19);
        data1.printDay();
        data2.printDay();
    }
}
